<?php

namespace app\model\zs;

use think\Model;

class ZsBusiness extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'business';

    // 设置当前模型的数据库连接
    protected $connection = 'zs';

    const STATUS_OFF = 0;
    const STATUS_ON = 1;

    // 295:天然居餐厅
    const TRJ = 295;
    // 1937:天然居包厢
    const TRJ_BX = 1937;

    public function shopDetail()
    {
        return $this->hasOne(ZsTwShopDetail::class, 'bid', 'id');
    }

    public function businessModel()
    {
        return $this->hasOne(ZsBusinessTakeAway::class, 'bid', 'id');
    }

    public static function statusRels()
    {
        return [
            0 => '无效',
            1 => '有效',
        ];
    }
}
